package com.abing.api.utils;

import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.DigestUtil;
import cn.hutool.crypto.digest.Digester;

/**
 * @Author CaptainBing
 * @Date 2024/8/21 20:44
 * @Description
 */
public class SignUtils {

    private SignUtils(){}

    /**
     * 生成签名
     * @param timestamp 时间戳
     * @param secret 密钥
     * @return
     */
    public static String genSign(String timestamp, String secret){

        Digester digester = DigestUtil.digester(DigestAlgorithm.MD5);
        String content = timestamp + "." + secret;
        return digester.digestHex(content);

    }

}
